package com.tianqi.common.enums;

/**
 * 日干对应的六神
 *
 * @author zhangzedi
 * @date 2023/8/20 16:16
 **/
public enum DayLiuShenEnum {

	JIA("甲", "青龙", "朱雀", "勾陈", "腾蛇", "白虎", "玄武"),

	YI("乙", "青龙", "朱雀", "勾陈", "腾蛇", "白虎", "玄武"),

	BING("丙", "朱雀", "勾陈", "腾蛇", "白虎", "玄武", "青龙"),

	DING("丁", "朱雀", "勾陈", "腾蛇", "白虎", "玄武", "青龙"),

	WU("戊", "勾陈", "腾蛇", "白虎", "玄武", "青龙", "朱雀"),

	JI("己", "腾蛇", "白虎", "玄武", "青龙", "朱雀", "勾陈"),

	GENG("庚", "白虎", "玄武", "青龙", "朱雀", "勾陈", "腾蛇"),

	XIN("辛", "白虎", "玄武", "青龙", "朱雀", "勾陈", "腾蛇"),

	REN("壬", "玄武", "青龙", "朱雀", "勾陈", "腾蛇", "白虎"),

	GUI("癸", "玄武", "青龙", "朱雀", "勾陈", "腾蛇", "白虎");
	/**
	 * 日干
	 */
	private String dayGan;

	/**
	 * 1爻六神
	 */
	private String liuShen1;

	/**
	 * 2爻六神
	 */
	private String liuShen2;

	/**
	 * 3爻六神
	 */
	private String liuShen3;

	/**
	 * 4爻六神
	 */
	private String liuShen4;

	/**
	 * 5爻六神
	 */
	private String liuShen5;

	/**
	 * 6爻六神
	 */
	private String liuShen6;

	public String getLiuShen1() {
		return liuShen1;
	}

	public String getLiuShen2() {
		return liuShen2;
	}

	public String getLiuShen3() {
		return liuShen3;
	}

	public String getLiuShen4() {
		return liuShen4;
	}

	public String getLiuShen5() {
		return liuShen5;
	}

	public String getLiuShen6() {
		return liuShen6;
	}

	public String getLiuShen(Integer index) {
		switch (index) {
			case 1:
				return liuShen1;
			case 2:
				return liuShen2;
			case 3:
				return liuShen3;
			case 4:
				return liuShen4;
			case 5:
				return liuShen5;
			case 6:
				return liuShen6;
			default:
				break;
		}
		return "";
	}

	public String getDayGan() {
		return dayGan;
	}

	DayLiuShenEnum(String dayGan, String liuShen1, String liuShen2, String liuShen3, String liuShen4, String liuShen5,
				   String liuShen6) {
		this.dayGan = dayGan;
		this.liuShen1 = liuShen1;
		this.liuShen2 = liuShen2;
		this.liuShen3 = liuShen3;
		this.liuShen4 = liuShen4;
		this.liuShen5 = liuShen5;
		this.liuShen6 = liuShen6;
	}

	/**
	 * 根据日干获取枚举
	 *
	 * @param dayGan
	 * @return
	 */
	public static DayLiuShenEnum getLiuQinByIndex(String dayGan) {
		DayLiuShenEnum[] values = DayLiuShenEnum.values();
		for (DayLiuShenEnum dayLiuShenEnum : values) {
			if (dayGan.equals(dayLiuShenEnum.getDayGan())) {
				return dayLiuShenEnum;
			}
		}
		return null;
	}
}
